package com.zephyr.vchcenter.bpm.action;

import org.apache.log4j.Logger;

import com.hiaward.bpm.action.TaskAction;
import com.hiaward.bpm.context.ServiceContext;
import com.hiaward.bpm.exception.ParameterException;
import com.hiaward.bpm.exception.ServiceException;
import com.zephyr.vchcenter.bean.Voucher;
import com.zephyr.vchcenter.dao.IBaseDao;
import com.zephyr.vchcenter.helper.SpringHelper;

public class AuditVerifyAction extends TaskAction {
	 private final Logger log=Logger.getLogger(AuditVerifyAction.class);
	public void perform(ServiceContext arg0) throws ServiceException,
			ParameterException {
		log.debug("���进入AuditVerifyAction...............");
		String vchsid=(String)arg0.getInputParameterValue("vchsid");
		String chkstate=(String)arg0.getInputParameterValue("chkstate");
		String checkreason=(String)arg0.getInputParameterValue("checkreason");
		IBaseDao dao=(IBaseDao)SpringHelper.getBean("baseDao");
        Voucher voucher=(Voucher)dao.findById("Voucher", vchsid);
        if(checkreason!=null){
        	voucher.setCheckreason(checkreason);
        }
        voucher.setChkstate(chkstate);
        dao.saveOrUpdate(voucher);
		log.debug("���˽��"+chkstate);
		log.debug("�AuditVerifyActionAuditVerifyActionAuditVerifyAction离开AuditVerifyAction..............");

	}
	public void serviceExceptionHandle(ServiceContext arg0,
			ServiceException arg1) {


	}

}
